import dayjs from 'dayjs'

export const sleep = (ms: number) => {
  return new Promise((resolve) => setTimeout(resolve, ms))
}

export const dateRender = (value: string, detail: boolean = false) => {
  if (!value) {
    return ''
  }
  if (detail) {
    return dayjs(value).format('YYYY年MM月DD日 HH:mm:ss')
  }
  return dayjs(value).format('YYYY年MM月DD日')
}
